-
Notifications
You must be signed in to change notification settings - Fork 76
The KING of Reverts #1598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The KING of Reverts #1598
Conversation
… deprecation of old constants"" This reverts commit 63ecf8a.
…Mode` enumeration and refine database handling"" This reverts commit 0037070.
Polished the `H2` compatibility `Mode` enum with improved formatting and readability. Addressed minor import reorganizations, streamlined `toDbType` and `fromDbType` methods, and fixed consistency in error messages. Updated tests and utilities accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors H2 database compatibility mode handling by introducing an enum-based approach to replace the previous dialect-based system. The changes enable better support for H2's Regular (native) mode and improve mode detection from both JDBC URLs and active connections.
Key changes:
- Introduced
H2.Modeenum to represent H2 compatibility modes (Regular, MySQL, PostgreSQL, MSSQLServer, MariaDB) - Refactored mode detection to query the active H2 connection's
INFORMATION_SCHEMA.SETTINGS - Added comprehensive tests for all supported H2 modes and unsupported mode error handling
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docs/StardustDocs/topics/dataSources/sql/H2.md | Added documentation and code examples for H2 compatibility modes |
| dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/H2.kt | Introduced Mode enum, deprecated old constructor, refactored delegate handling for null mode |
| dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/util.kt | Extracted and refactored H2 mode parsing logic into helper functions, improved connection-based mode detection |
| dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/h2/h2Test.kt | Added tests for all H2 compatibility modes and unsupported mode error cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dataframe-jdbc/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/h2/h2Test.kt
Show resolved
Hide resolved
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/H2.kt
Show resolved
Hide resolved
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/H2.kt
Outdated
Show resolved
Hide resolved
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/H2.kt
Outdated
Show resolved
Hide resolved
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/util.kt
Outdated
Show resolved
Hide resolved
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db/util.kt
Show resolved
Hide resolved
koperagen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, please answer tiny question above and fix the build: apiDump and linter maybe
Closes #1595